repo: Flip the fsync default to off for new checkout API
authorColin Walters <walters@verbum.org>
Wed, 3 Aug 2016 14:55:35 +0000 (10:55 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 4 Aug 2016 07:33:31 +0000 (07:33 +0000)
Since we're adding a new API, we have the opportunity to fix
the defaults.  We expect clients to do a `syncfs()` or equivalent
on their own now, since it's way more efficient.

Flip the checkout fsync default to off.

Closes: #425
Approved by: giuseppe

src/libostree/ostree-repo-checkout.c
src/libostree/ostree-repo.h
src/libostree/ostree-sysroot-deploy.c

index 4e0f0a2352ad6879be881ab4e3cfd91e3a66b32e..bf18c9e4eb6761d9b1fde203eb8a8a95b1c16099 100644 (file)
@@ -106,7 +106,7 @@ static gboolean
 fsync_is_enabled (OstreeRepo   *self,
                   OstreeRepoCheckoutAtOptions *options)
 {
-  return !(self->disable_fsync || options->disable_fsync);
+  return options->enable_fsync || !self->disable_fsync;
 }
 
 static gboolean
@@ -860,7 +860,7 @@ ostree_repo_checkout_tree_at (OstreeRepo                        *self,
   new_opts.mode = options->mode;
   new_opts.overwrite_mode = options->overwrite_mode;
   new_opts.enable_uncompressed_cache = options->enable_uncompressed_cache;
-  new_opts.disable_fsync = options->disable_fsync;
+  new_opts.enable_fsync = !options->disable_fsync;
   new_opts.process_whiteouts = options->process_whiteouts;
   new_opts.no_copy_fallback = options->no_copy_fallback;
   new_opts.subpath = options->subpath;
index 0b99c9dd6e7bcf23efbd89a8e9c5ec5d5b8da730..f1ba22f18fff5650ff4dc5cee7687d3f14b73663 100644 (file)
@@ -748,8 +748,8 @@ typedef struct {
   OstreeRepoCheckoutMode mode;
   OstreeRepoCheckoutOverwriteMode overwrite_mode;
 
-  gboolean enable_uncompressed_cache;
-  gboolean disable_fsync;
+  gboolean enable_uncompressed_cache;  /* Deprecated */
+  gboolean enable_fsync;  /* Deprecated */
   gboolean process_whiteouts;
   gboolean no_copy_fallback;
 
index d4feb7ed5ab0f7f532b1976d6693fbc464fd717d..7b8173b6da15d7be77a1167a34a1e239c7624fb8 100644 (file)
@@ -554,11 +554,6 @@ checkout_deployment_tree (OstreeSysroot     *sysroot,
   glnx_fd_close int osdeploy_dfd = -1;
   int ret_fd;
 
-  /* We end up using syncfs for the entire filesystem, so turn off
-   * OstreeRepo level fsync.
-   */
-  checkout_opts.disable_fsync = TRUE;
-
   osdeploy_path = g_strconcat ("ostree/deploy/", ostree_deployment_get_osname (deployment), "/deploy", NULL);
   checkout_target_name = g_strdup_printf ("%s.%d", csum, ostree_deployment_get_deployserial (deployment));